<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

    <style type="text/css" media="screen">
        @import url("<c:url value="/resources/dojo/resources/dojo.css"/>");
        @import url("<c:url value="/resources/dijit/themes/tundra/tundra.css"/>");
        @import url("<c:url value="/static/styles/finance.css"/>");
    </style>

    <script djconfig="parseOnLoad: true" src="<c:url value="/resources/dojo/dojo.js"/>" type="text/javascript"></script>
    <script type="text/javascript" src="<c:url value="/resources/spring/Spring.js" />"></script>
    <script type="text/javascript" src="<c:url value="/resources/spring/Spring-Dojo.js" />"></script>
    <script type="text/javascript">dojo.require("dojo.parser");</script>
    <title>Spring Finance</title>

</head>

<body class="tundra spring">

<div id="wrap">

    <div id="menu">
        <%@ include file="/WEB-INF/jsp/menu.jsp" %>
    </div>
    <div id="main">
        <div id="body">

            <h2/>Internal error</h2>
            <p/>

            <%
                try {
                    // The Servlet spec guarantees this attribute will be available
                    Throwable exception = (Throwable) request.getAttribute("javax.servlet.error.exception");

                    if (exception != null) {
                        if (exception instanceof ServletException) {
                            // It's a ServletException: we should extract the root cause
                            ServletException sex = (ServletException) exception;
                            Throwable rootCause = sex.getRootCause();
                            if (rootCause == null)
                                rootCause = sex;
                            out.println("** Root cause is: " + rootCause.getMessage());
                            rootCause.printStackTrace(new java.io.PrintWriter(out));
                        } else {
                            // It's not a ServletException, so we'll just show it
                            exception.printStackTrace(new java.io.PrintWriter(out));
                        }
                    } else {
                        out.println("No error information available");
                    }

                    // Display cookies
                    out.println("\nCookies:\n");
                    Cookie[] cookies = request.getCookies();
                    if (cookies != null) {
                        for (int i = 0; i < cookies.length; i++) {
                            out.println(cookies[i].getName() + "=[" + cookies[i].getValue() + "]");
                        }
                    }

                } catch (Exception ex) {
                    ex.printStackTrace(new java.io.PrintWriter(out));
                }
            %>

            <p/>
            <br/>


        </div>
        <table class="footer">
            <tr>
                <td><a href="<c:url value="/" />">Home</a></td>
                <td align="right"><a href="http://stsmedia.net" alt="StSMedia.net">StSMedia.net</a></td>
            </tr>
        </table>

    </div>
</div>
</body>

</html>
